use std::env;
use crate::base::ServerError;
use crate::db::init_sqlite_pool;

pub mod db;
pub mod base;
mod tau;
pub mod task;


pub async fn run_app() -> Result<(), ServerError> {
    init_sqlite_pool()
        .await?;
    tau::tauri_start();
    setup_logger().await?;
    Ok(())
}
// 初始化日志
async fn setup_logger() -> Result<(), ServerError> {
    env::set_var("RUST_LOG", "debug");
    // 设置用户缓存
    tracing::info!("启动成功");

    tracing_subscriber::fmt::init();
    Ok(())
}
